//app.js
let datas = require('./datas')
App({

  globalData: {
    userInfo: null,
    datas,
  },
  createBackgroundMusic() {
    // console.log("正在下载歌曲！");
    var bgm = wx.createInnerAudioContext();
    bgm.autoplay = true;
    bgm.loop = false;
    // bgm.src = "https://m10.music.126.net/20200512185029/b3b8aca1d5984a04b55392e8c9896ff0/ymusic/a5e0/56eb/c6f0/06e580cf1f74b27c59cb61451c2b59ef.mp3";
    bgm.src = "images/bgm.mp3";
    bgm.onPlay(() => {
      console.log("开始播放音频了。");
    })
    // console.log(bgm);
  },
  onLaunch (options) {
  //  this.createBackgroundMusic();
  },
  onShow() {
   this.createBackgroundMusic();
  }
})
